home *** CD-ROM | disk | FTP | other *** search
/ Guia CD-ROM 25 / GUIACD25.iso / bht / shared.dir / 01240_Movie Script Main.ls < prev    next >
Encoding:
Text File  |  1996-02-08  |  7.5 KB  |  351 lines

  1. on PlayVoice
  2.   global voicePath, currentVoice
  3.   sound stop 1
  4.   if currentVoice = EMPTY then
  5.     exit
  6.   end if
  7.   sound playFile 1, voicePath & currentVoice
  8. end
  9.  
  10. on PlaySoundTrack
  11.   global soundTrackPath, currentsoundTrack
  12.   if soundBusy(2) then
  13.     exit
  14.   end if
  15.   sound playFile 2, soundTrackPath & currentsoundTrack
  16. end
  17.  
  18. on ToggleVolumeWindow
  19.   global vWindow, vSlider1, vSlider2, volumeHPositions
  20.   if the left of sprite vWindow > 641 then
  21.     set the locH of sprite vWindow to value(item 1 of volumeHPositions)
  22.     set the locH of sprite vSlider1 to value(item 2 of volumeHPositions)
  23.     set the locH of sprite vSlider2 to value(item 3 of volumeHPositions)
  24.     updateStage()
  25.   else
  26.     set the locH of sprite vWindow to 12000
  27.     set the locH of sprite vSlider1 to 12000
  28.     set the locH of sprite vSlider2 to 12000
  29.     updateStage()
  30.   end if
  31. end
  32.  
  33. on dragSlider whichOne
  34.   global sliderTop, sliderBottom
  35.   set vOffset to the locV of sprite whichOne - the mouseV
  36.   repeat while the stillDown
  37.     if (the mouseV >= sliderTop) and (the mouseV <= sliderBottom) then
  38.       set the locV of sprite whichOne to the mouseV + vOffset
  39.       updateStage()
  40.     end if
  41.   end repeat
  42.   SetSliderLevel(whichOne)
  43. end
  44.  
  45. on SetSliderVolume whichChannel
  46.   global sliderTop, sliderBottom, vSlider1, vSlider2, ambientLevel, voiceLevel
  47.   if whichChannel = vSlider1 then
  48.     set channelNum to 1
  49.   else
  50.     set channelNum to 2
  51.   end if
  52.   set volumeTop to 255
  53.   set range to sliderBottom - sliderTop
  54.   set howLoud to the volume of sound channelNum
  55.   set the locV of sprite whichChannel to sliderBottom - integer(range * howLoud / volumeTop)
  56.   updateStage()
  57. end
  58.  
  59. on SetSliderLevel whichSlider
  60.   global sliderTop, sliderBottom, vSlider1, vSlider2, ambientLevel, voiceLevel
  61.   set range to sliderBottom - sliderTop
  62.   set where to sliderBottom - the locV of sprite whichSlider
  63.   set where to float(where) / range
  64.   set sliderV to integer(where * 255)
  65.   if whichSlider = vSlider1 then
  66.     set the volume of sound 1 to sliderV
  67.     set voiceLevel to sliderV
  68.   else
  69.     set the volume of sound 2 to sliderV
  70.     set ambientLevel to sliderV
  71.   end if
  72.   updateStage()
  73. end
  74.  
  75. on keyCheck
  76.   if the key = " " then
  77.     ToggleVolumeWindow()
  78.   end if
  79. end
  80.  
  81. on soundSetup
  82.   global voicePath, soundTrackPath, currentVoice, currentsoundTrack, vWindow, vSlider1, vSlider2, sliderTop, sliderBottom, volumeHPositions, ambientLevel, voiceLevel
  83.   set vWindow to 46
  84.   set vSlider1 to 47
  85.   set vSlider2 to 48
  86.   set sliderTop to the top of sprite vWindow + 26
  87.   set sliderBottom to the bottom of sprite vWindow - 32
  88.   set volumeHPositions to "320,302,338"
  89.   set the volume of sound 2 to ambientLevel
  90.   set the volume of sound 1 to voiceLevel
  91.   SetSliderVolume(vSlider1)
  92.   SetSliderVolume(vSlider2)
  93.   when keyDown then keyCheck
  94. end
  95.  
  96. on ClearPuppets
  97.   repeat with i = 1 to 44
  98.     puppetSprite(i, 0)
  99.   end repeat
  100. end
  101.  
  102. on stopMovie
  103.   global gFlyThru, gCraftBefore
  104.   repeat with i = 1 to 40
  105.     puppetSprite(i, 0)
  106.   end repeat
  107.   set gFlyThru to 2
  108.   set gCraftBefore to 0
  109.   set the timeoutScript to "nothing"
  110.   ClearPuppets()
  111.   sound stop 1
  112.   sound fadeOut 2, 1 * 60
  113.   sound fadeIn 2, 1 * 60
  114. end
  115.  
  116. on NextScreen
  117.   ClearPuppets()
  118.   sound stop 1
  119.   unLoad()
  120.   set lFrame1 to marker(1)
  121.   set lFrame2 to marker(2) - 1
  122.   preLoad(lFrame1, lFrame2)
  123. end
  124.  
  125. on EndOfSceneFrame lFrame
  126.   global gWaitForUser
  127.   if gWaitForUser = 0 then
  128.     go(the frame)
  129.   else
  130.     if soundBusy(1) = 1 then
  131.       go(the frame)
  132.     else
  133.       NextScreen()
  134.       go(lFrame)
  135.     end if
  136.   end if
  137. end
  138.  
  139. on EndOfScene
  140.   global gWaitForUser
  141.   if gWaitForUser = 0 then
  142.     go(the frame)
  143.   else
  144.     if soundBusy(1) = 1 then
  145.       go(the frame)
  146.     else
  147.       NextScreen()
  148.       go(marker(1))
  149.     end if
  150.   end if
  151. end
  152.  
  153. on EndOfSceneWithLoop
  154.   global gWaitForUser
  155.   if (the frame + 1) = marker(1) then
  156.     if gWaitForUser = 0 then
  157.       go(marker(0) + 1)
  158.     else
  159.       if soundBusy(1) = 1 then
  160.         go(marker(0) + 1)
  161.       else
  162.         NextScreen()
  163.         go(marker(1))
  164.       end if
  165.     end if
  166.   else
  167.     if gWaitForUser = 0 then
  168.       go(the frame + 1)
  169.     else
  170.       if soundBusy(1) = 1 then
  171.         go(the frame + 1)
  172.       else
  173.         NextScreen()
  174.         go(marker(1))
  175.       end if
  176.     end if
  177.   end if
  178. end
  179.  
  180. on EndOfSceneWithLoopMovie lmovie
  181.   global gWaitForUser
  182.   if (the frame + 1) = marker(1) then
  183.     if gWaitForUser = 0 then
  184.       go(marker(0) + 1)
  185.     else
  186.       if soundBusy(1) = 1 then
  187.         go(marker(0) + 1)
  188.       else
  189.         ClearPuppets()
  190.         puppetSprite(45, 0)
  191.         go(1, lmovie)
  192.       end if
  193.     end if
  194.   else
  195.     if gWaitForUser = 0 then
  196.       go(the frame + 1)
  197.     else
  198.       if soundBusy(1) = 1 then
  199.         go(the frame + 1)
  200.       else
  201.         ClearPuppets()
  202.         puppetSprite(45, 0)
  203.         go(1, lmovie)
  204.       end if
  205.     end if
  206.   end if
  207. end
  208.  
  209. on EndOfSceneFinal
  210.   global gWaitForUser
  211.   if gWaitForUser = 0 then
  212.     go(the frame)
  213.   else
  214.     if soundBusy(1) = 1 then
  215.       go(the frame)
  216.     else
  217.       NextScreen()
  218.       go("enter", "Main")
  219.     end if
  220.   end if
  221. end
  222.  
  223. on EndOfSceneFinalWithLoop
  224.   global gWaitForUser
  225.   if (the frame + 1) = marker(1) then
  226.     if gWaitForUser = 0 then
  227.       go(marker(0) + 1)
  228.     else
  229.       if soundBusy(1) = 1 then
  230.         go(marker(0) + 1)
  231.       else
  232.         ClearPuppets()
  233.         puppetSprite(45, 0)
  234.         go("Enter", "Main")
  235.       end if
  236.     end if
  237.   else
  238.     if gWaitForUser = 0 then
  239.       go(the frame + 1)
  240.     else
  241.       if soundBusy(1) = 1 then
  242.         go(the frame + 1)
  243.       else
  244.         ClearPuppets()
  245.         puppetSprite(45, 0)
  246.         go("Enter", "Main")
  247.       end if
  248.     end if
  249.   end if
  250. end
  251.  
  252. on EndOfSceneMovie lmovie
  253.   global gWaitForUser
  254.   if gWaitForUser = 0 then
  255.     go(the frame)
  256.   else
  257.     if soundBusy(1) = 1 then
  258.       go(the frame)
  259.     else
  260.       ClearPuppets()
  261.       puppetSprite(45, 0)
  262.       go(1, lmovie)
  263.     end if
  264.   end if
  265. end
  266.  
  267. on NextScreenFrame lFrame
  268.   ClearPuppets()
  269.   sound stop 1
  270.   unLoad()
  271.   set lFrame1 to lFrame
  272.   go(lFrame)
  273.   set lFrame2 to marker(1) - 1
  274.   preLoad(lFrame1, lFrame2)
  275. end
  276.  
  277. on EndOfSceneWithQT lSpriteNumber
  278.   global gWaitForUser
  279.   if the movieTime of sprite lSpriteNumber < the stopTime of sprite lSpriteNumber then
  280.     go(the frame)
  281.     exit
  282.   else
  283.     if gWaitForUser = 0 then
  284.       go(the frame)
  285.     else
  286.       NextScreen()
  287.       set the movieTime of sprite lSpriteNumber to 0
  288.       set the movieRate of sprite lSpriteNumber to 0
  289.       go(marker(1))
  290.     end if
  291.   end if
  292. end
  293.  
  294. on ResetQT lSpriteNumber
  295.   set the movieTime of sprite lSpriteNumber to 0
  296.   set the movieRate of sprite lSpriteNumber to 0
  297. end
  298.  
  299. on EndOfSceneMovieWithQT lSpriteNumber, lmovie
  300.   global gWaitForUser
  301.   if the movieTime of sprite lSpriteNumber < the stopTime of sprite lSpriteNumber then
  302.     go(the frame)
  303.     exit
  304.   else
  305.     if gWaitForUser = 0 then
  306.       go(the frame)
  307.     else
  308.       NextScreen()
  309.       set the movieTime of sprite lSpriteNumber to 0
  310.       set the movieRate of sprite lSpriteNumber to 0
  311.       ClearPuppets()
  312.       puppetSprite(45, 0)
  313.       go(1, lmovie)
  314.     end if
  315.   end if
  316. end
  317.  
  318. on waitNew lamount
  319.   startTimer()
  320.   repeat while the timer < (lamount * 60)
  321.     nothing()
  322.   end repeat
  323. end
  324.  
  325. on checkDOS SoundFileName
  326.   set x to offset(".", SoundFileName)
  327.   put "Sound name:" && SoundFileName && "    Name length =" && string(x - 1)
  328.   if x > 9 then
  329.     alert("Name too long")
  330.   end if
  331. end
  332.  
  333. on checkColor
  334.   repeat with x = 1 to 1200
  335.     if the castType of cast x = #bitmap then
  336.       if the depth of cast x > 8 then
  337.         alert("Crummy Cast" && "at cast" && string(x))
  338.       end if
  339.     end if
  340.   end repeat
  341. end
  342.  
  343. on checkInks
  344.   repeat with x = 1 to 30
  345.     set i to the ink of sprite x
  346.     if i <> 0 then
  347.       put "sprite" && x && "uses ink effect:" && i
  348.     end if
  349.   end repeat
  350. end
  351.